package com.senlingspace.system.domain.vo;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * \
 *
 * @author Administrator
 */
@Data
public class ShareVo implements Serializable {
    // 创建Map用于存储订单票档类型占比
    private List<Map<String, Object>> ticketLevelRatios;
    // 创建Map用于存储订单来源占比
    private List<Map<String,Object>> sourceCounts;
    // 创建Map用于存储订单状态占比
    private List<Map<String, Object>> statusCounts;
    //创建Map用于存储订单内容占比
    private List<Map<String, Object>> projectCounts;
    public void initializeDefaults() {
        if (this.ticketLevelRatios == null || this.ticketLevelRatios.isEmpty()) {
            this.ticketLevelRatios = initializeDefaultTicketLevelRatios();
        }
        if (this.sourceCounts == null || this.sourceCounts.isEmpty()) {
            this.sourceCounts = initializeDefaultSourceCounts();
        }
        if (this.statusCounts == null || this.statusCounts.isEmpty()) {
            this.statusCounts = initializeDefaultStatusCounts();
        }
        if (this.projectCounts == null || this.projectCounts.isEmpty()) {
            this.projectCounts = initializeDefaultProjectCounts();
        }
    }

    // 初始化默认的票档销售占比
    private List<Map<String, Object>> initializeDefaultTicketLevelRatios() {
        List<Map<String, Object>> defaultTicketLevelRatios = new ArrayList<>();
        Map<String, Object> defaultTicketLevelRatio = new HashMap<>();
        defaultTicketLevelRatio.put("name", "今日暂无数据");
        defaultTicketLevelRatio.put("value", 0.0);
        defaultTicketLevelRatios.add(defaultTicketLevelRatio);
        return defaultTicketLevelRatios;
    }

    // 初始化默认的出票渠道占比
    private List<Map<String, Object>> initializeDefaultSourceCounts() {
        List<Map<String, Object>> defaultSourceCounts = new ArrayList<>();
        Map<String, Object> defaultSourceCount = new HashMap<>();
        defaultSourceCount.put("name", "今日暂无数据");
        defaultSourceCount.put("value", 0L);
        defaultSourceCounts.add(defaultSourceCount);
        return defaultSourceCounts;
    }

    // 初始化默认的订单状态占比
    private List<Map<String, Object>> initializeDefaultStatusCounts() {
        List<Map<String, Object>> defaultStatusCounts = new ArrayList<>();
        Map<String, Object> defaultStatusCount = new HashMap<>();
        defaultStatusCount.put("name", "今日暂无数据");
        defaultStatusCount.put("value", 0L);
        defaultStatusCounts.add(defaultStatusCount);
        return defaultStatusCounts;
    }

    // 初始化默认的订单内容占比
    private List<Map<String, Object>> initializeDefaultProjectCounts() {
        List<Map<String, Object>> defaultProjectCounts = new ArrayList<>();
        Map<String, Object> defaultProjectCount = new HashMap<>();
        defaultProjectCount.put("name", "今日暂无数据");
        defaultProjectCount.put("value", 0L);
        defaultProjectCounts.add(defaultProjectCount);
        return defaultProjectCounts;
    }
}
